<template>
	<view class="page-body pd40">
		<view class="text-area">
			<textarea name="" id="" cols="30" rows="10" placeholder="请输入您的宝贵意见,这将是我们进步的阶梯" v-model="feedback" @input="inputfeedback"> 
				
			</textarea>
			<view :class="['button ',isdisabled?'disabled':'primary']" @click="besure">立即提交</view>
		</view>
	</view>
</template>

<script>
	var that;
	export default {
		data() {
			return {
				isdisabled:true,
				feedback:""
			}
		},
		onLoad(){
			that=this;
			// #ifdef APP-PLUS
			// #endif
		},
		methods: {
			inputfeedback(e){
				// console.log(e)
				let value=e.detail.value
				if(value.length>0){
					this.isdisabled=false
				}else{
					this.isdisabled=true
				}
			},
			besure(){
				let feedback=this.feedback
				this.$https.POST({
					url:"/user/suggestBack",
					data:{
						suggest:feedback
					},
					success(res){
						that.$showToast(res.message)
						that.feedback="";
						that.isdisabled=true
					}
				})
			}
		}
	}
</script>

<style>
	page{background: #f6f6f6;}
	.text-area{
		width: 670upx;margin: 0 auto;height:300upx;background: #fff;margin-top:30upx;
	}
	.text-area textarea{padding: 20upx;border-radius: 20upx;box-sizing: border-box;width: 100%;}
	.button{margin-top: 40upx;}
	.button.disabled{
		background: #c7c7c7;
	}
	/* .button.primary{
		background: linear-gradient(47deg, #ff7201 0%, #ff922c 100%);
	} */
</style>
